var express = require('express');
var router = express.Router();
let mongoose = require('mongoose');
let jsonwebtoken = require('jsonwebtoken')
require('../util/authConfig.js')

router.get('/getUserInFor', function (req, resp) {
    //接收前端发送的token数据，进行解密操作
    let auth = req.header('Authorization')
    let token = auth.replace('Bearer ','')
    //将token揭秘
    let useObj = jsonwebtoken.verify(token,'star').user
    resp.send({
        code:1,
        message:'鉴权成功',
        data:useObj
    })
})



module.exports = router